<?php

class pastaprimavera_scraper extends BlogScraper
{
    function __construct()
    {
        parent::__construct('pastaprimavera');
    }
}

class pastaprimavera_post_scraper extends PostScraper
{
    
    function prepareTrack($track)
    {
        $name_parts = explode('–', $track['name']);
        
        if (count($name_parts) == 2)
        {
            $track['artist'] = $this->removeQuotes(trim($name_parts[0]));
            $track['song'] = $this->removeQuotes(trim($name_parts[1]));
            $track['name'] = $track['artist'].'-'.$track['song'];
        }
        

        return $track;
    }
    
    function getTitle()
    {
        return $this->xpath->query('//h1/a')->item(0)->nodeValue;
    }
   
    function getDate()
    {
        $date_node = $this->xpath->query("//abbr")->item($this->post_index)->getAttribute('title');
        return date('Y-m-d H:i:s', strtotime($date_node));

    }
    
    function getText()
    {
        $text = parent::getText();
        $text = str_replace("A Baltimore Based Indie Music Blog", "", $text);
        return $text;
       
    }

    
    
}

?>